Datatypes and Subtyping

نویسندگان

  • Haruo Hosoya
  • Benjamin C. Pierce
چکیده

We study a calculus with both subtyping and datatype deenitions. Our primary goal is to understand the interaction of subtyping with mutually recursive types, which raises diiculties beyond those addressed in previous studies. A second aim is to clarify the relations between structural subtyping and the user-declared subtyping found in languages such as C++, Eiiel, and Java.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Subtyping and Inheritance for Categorical

We extend Hagino's categorical datatypes with subtyping and a limited form of inheritance. The view of objects as coalgebras provides the inspiration for subtyping and inheritance for coalgebraic (or coinductive) types. Exploiting the duality between coalgebras and algebras then yields notions of subtyping and inheritance for algebraic (or inductive) types.

متن کامل

GADT meet Subtyping

While generalized abstract datatypes (GADT) are now considered well-understood, adding them to a language with a notion of subtyping comes with a few surprises. What does it mean for a GADT parameter to be covariant? The answer turns out to be quite subtle. It involves fine-grained properties of the subtyping relation that raise interesting design questions. We allow variance annotations in GAD...

متن کامل

Constructor Subtyping

Constructor subtyping is a form of subtyping in which an induc tive type is viewed as a subtype of another inductive type if has more constructors than As suggested in its potential uses include proof assistants and functional programming languages In this paper we introduce and study the properties of a simply typed calculus with record types and datatypes and which supports record sub typing ...

متن کامل

GADTs Meet Subtyping

While generalized algebraic datatypes (GADTs) are now considered well-understood, adding them to a language with a notion of subtyping comes with a few surprises. What does it mean for a GADT parameter to be covariant? The answer turns out to be quite subtle. It involves fine-grained properties of the subtyping relation that raise interesting design questions. We allow variance annotations in G...

متن کامل

Modular Visitor Components A Practical Solution to the Expression Families Problem

The expression families problem can be defined as the problem of achieving reusability and composability across the components involved in a family of related datatypes and corresponding operations over those datatypes. Like the traditional expression problem, adding new components (either variants or operations) should be possible while preserving modular and static type-safety. Moreover, diff...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007